From 2e855196c78420b76f6f6cb92822255669599d7e Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Tue, 18 Apr 2017 08:01:40 -0400 Subject: [PATCH] Improve which-key--any-match-p --- which-key.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/which-key.el b/which-key.el index 825e1cb0377..6cc4fd9fc31 100644 --- a/which-key.el +++ b/which-key.el @@ -2023,11 +2023,10 @@ prefix) if `which-key-use-C-h-commands' is non nil." (defun which-key--any-match-p (regexps string) "Non-nil if any of REGEXPS match STRING." - (let (match) + (catch 'match (dolist (regexp regexps) (when (string-match-p regexp string) - (setq match t))) - match)) + (throw 'match t))))) (defun which-key--try-2-side-windows (keys page-n loc1 loc2 &rest _ignore) "Try to show KEYS (PAGE-N) in LOC1 first. Only if no keys fit fallback to LOC2." -- 2.30.2